// services/index.ts
export * from './api/user'
export * from './api/upload'
export * from './api/common'
export * from './api/video'
export * from './api/audio'
export * from './types'

/*
// app/components/UserList.tsx
import { userService } from '@/services';

export const UserList = () => {
  const [users, setUsers] = useState<User[]>([]);

  const fetchUsers = async () => {
    try {
      const data = await userService.getUsers();
      setUsers(data);
    } catch (error) {
      // 错误已经在 request.ts 中统一处理
      console.error(error);
    }
  };

  return (
    // ...
  );
};

// app/components/FileUploader.tsx
import { uploadService } from '@/services';

export const FileUploader = () => {
  const handleUpload = async (file: File) => {
    try {
      const result = await uploadService.uploadFile(file, (progress) => {
        console.log(`上传进度: ${progress}%`);
      });
      console.log('上传成功:', result.url);
    } catch (error) {
      console.error(error);
    }
  };

  return (
    // ...
  );
};

*/
